﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CrossGenLogic;

namespace CrossGenGUI
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Generation gen = new Generation("voc.txt", "grid.txt");
            gen.Generate(0);
            dataGridView1.ColumnHeadersVisible = false;
            dataGridView1.RowHeadersVisible = false;
            dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            dataGridView1.RowCount = gen.CrossHeigth();
            dataGridView1.ColumnCount = gen.CrossWidth();

            for (int i = 0; i < gen.CrossHeigth(); i++)
                for (int j = 0; j < gen.CrossWidth(); j++)
                {
                    dataGridView1.Rows[i].Cells[j].Value = gen.GetChar(j, i);
                }
        }
    }
}
